Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert apache2.access to ECS - Take 2 #9245

Merged
merged 14 commits into from
Nov 29, 2018
Merged

Conversation

webmat
Copy link
Contributor

@webmat webmat commented Nov 27, 2018

Taking over #8901, and I don't have write access to @ruflin's repo.

TODO:

  • Rebase needed
  • Can't alias apache2.access.remote_ip (ecs-migration.yml)
  • Create aliases in the module's field definitions
  • HTTP metrics comment (not a deal breaker)
  • source.hostname not in ECS
  • referer typo
  • user_agent parsing currently broken
  • Add test for a named host as the remote
  • Make integer fields great again
  • Changelog
  • Fix rebase issues
  • Remove commented out url.original from filebeat/_meta/fields.common.yml. It's a dupe of libbeat/_meta/fields.ecs.yml definition.
  • Figure out apparently unrelated breakage about a generated file: https://travis-ci.org/elastic/beats/jobs/460918667

Unrelated

  • Did I list the geoip aliases in ecs-migration.yml in the other PRs?

Closes #8901, partially addresses #8655.

@webmat webmat self-assigned this Nov 27, 2018
@webmat webmat requested a review from ruflin November 27, 2018 04:59
@webmat
Copy link
Contributor Author

webmat commented Nov 27, 2018

@ruflin I brought your initial Apache2 access PR exactly in line with the other recent access log PRs. Expecting to have the build work the first time.

@webmat
Copy link
Contributor Author

webmat commented Nov 28, 2018

Only failure in Jenkins was a network hiccup on Ubuntu:

22:30:27 gvm: error: http get failed: Get https://storage.googleapis.com/golang/go1.11.2.linux-amd64.tar.gz: dial tcp 108.177.112.128:443: i/o timeout

ruflin and others added 12 commits November 28, 2018 14:00
* Update ecs-migration.yml file
* Update changelog
* Update generated files
* Link old fields

Todo:
* Add aliases for old fields
- remove `source.hostname` field definition
- remove misspelled `http.request.referer`. The rreal one is already defined.
- pipeline reverted to populate `apache2.access.remote_ip`.
- add split to source.ip or source.domain as a separate grok.
- Output the ua string to the field not afflicted with a typo.
- Fix user agent parsing
- Add a log entry with a hostname as the remote host, instead of an IP
- Add leniency to geoip filter, if remote host is a hostname instead of an IP (no ip field)
- Remove unneeded definition for `http.response.body_sent.bytes`.
- Re-introduce `apache2.access.remote_ip` field definition.
- Alias all `apache2.access.*` that have moved.
Dupe of definition in `libbeat/_meta/fields.ecs.yml`.
@webmat
Copy link
Contributor Author

webmat commented Nov 28, 2018

@ruflin Ok, ready for final review. Everything is green, and even fixes the test breakage in master.

filebeat/docs/fields.asciidoc Show resolved Hide resolved
filebeat/docs/fields.asciidoc Show resolved Hide resolved
@jsoriano
Copy link
Member

For a future change, we might consider to rename the apache2 module to apache.

@webmat
Copy link
Contributor Author

webmat commented Nov 29, 2018

@jsoriano Actually "Apache" is the foundation. The webserver is actually called "httpd" ;-)

@webmat
Copy link
Contributor Author

webmat commented Nov 29, 2018

But I totally agree on another part of your point. The number is problematic. Will "apache2" support Apache httpd v3? So yeah, the number has to go eventually

@webmat webmat merged commit 671cdc0 into elastic:master Nov 29, 2018
@webmat webmat deleted the ecs-apache2-access branch November 29, 2018 14:57
@jsoriano
Copy link
Member

@webmat apart of the number I was mentioning that to use the same name as the metricbeat module, though we can also rename both to httpd 😄

@webmat
Copy link
Contributor Author

webmat commented Nov 29, 2018

Ah I was not aware of that. Thanks for mentioning it! >> /mat/brain 😆

DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
- Convert many fields under `apache2.access.*` to ECS. Previous field names are field aliases towards the new corresponding ECS field:
  - apache2.access.user_name => user.name
  - apache2.access.method => http.request.method
  - apache2.access.url => url.original
  - apache2.access.http_version => http.version
  - apache2.access.response_code => http.response.status_code
  - apache2.access.referrer => http.request.referrer
  - apache2.access.agent => user_agent.original
  - read_timestamp => event.created
  - apache2.access.geoip.* => source.geo.*
  - apache2.access.user_agent.* => user_agent.*
- Rename common field `url.href` to `url.original`, bringing it in line with ECS
- Remove field defs which are no longer in ECS:
  - url.href.raw
  - source.hostname
- Add a log entry with a hostname as the remote host, instead of an IP
- Add leniency to geoip filter, if remote host is a hostname instead of an IP (no ip field)
- Coerce int fields to ints: status_code, sent bytes
- Fix unrelated test failure caused by generated code (under x-pack/metricbeat) that seems to be outdated in master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants